# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=massif-visualizer
pkgver=0.7.0
pkgrel=0
pkgdesc="Visualizer for Valgrind Massif data files"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://kde.org/applications/development/org.kde.massif-visualizer"
license="GPL-2.0-or-later"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtsvg-dev qt5-qtxmlpatterns-dev karchive-dev kconfig-dev kcoreaddons-dev kparts-dev kio-dev ki18n-dev kdiagram-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/massif-visualizer/$pkgver/src/massif-visualizer-$pkgver.tar.xz"
subpackages="$pkgname-lang"

build() {
	# The infowidget plugin is disabled due to an incompatibility with musl
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_INFOWIDGET_PLUGIN=FALSE
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="058412e34c0899a34fb4080a602cb0c70a9ac707f27b72a79fb412ea35a6e8c66ce06df15b3153fdc1a70a27232f98b508c7441b657eb73466962b33f9b2f561  massif-visualizer-0.7.0.tar.xz"
